package com.leyou.common.vo;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 *
 * @author: wangzibeng
 * Date: 2019/4/28 0028
 * Time: 17:04
 */

@Data
@NoArgsConstructor
public class PageResult<T> {
    /**
     * 总条数
     */
    private Long total;
    /**
     * 总页数
     */
    private Integer totalPage;
    /**
     * 当前页数据
     */
    private List<T> items;

    /**
     * 总记录数
     * <p>
     * 页面数据
     *
     * @param total
     * @param items
     */
    public PageResult(Long total, List<T> items) {
        this.total = total;
        this.items = items;
    }

    /**
     *
     * @param total
     * @param totalPage
     * @param items
     */
    public PageResult(Long total, Integer totalPage, List<T> items) {
        this.total = total;
        this.totalPage = totalPage;
        this.items = items;
    }
}
